package com.example.guiguihomemedical.service.impl;

import com.example.guiguihomemedical.entity.Doctor;
import com.example.guiguihomemedical.mapper.DoctorMapper;
import com.example.guiguihomemedical.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DoctorServiceImpl implements DoctorService {
    @Autowired
    private DoctorMapper doctorMapper;

    public Doctor login(Doctor doctor) {
        return doctorMapper.findByUsernamePassword(doctor);
    }

    @Override
    public Doctor findByDoctorId(int doctorId) {
        return doctorMapper.findByDoctorId(doctorId);
    }

    @Override
    public void ChangePassword(String newPassword, int doctorId) {
        doctorMapper.ChangePassword(newPassword, doctorId);
    }
}
